<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a>首页轮播设置</a></li>
			<li><a href="{:U('Goods/hpage_edit')}">首页图片添加</a></li>
		</ul>
		<form method="post" action="{:U('Goods/hp_sort')}" class="js-ajax-form">
			<div class="table-actions">
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit">排序</button>
			</div>
			<table class="table table-hover table-bordered" id='tab_check'>
				<thead>
					<tr>
						<th>排序</th>
						<th style='min-width: 50px;' align="center">修改时间</th>
						<th>图片</th>
						<th>跳转地址</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<foreach name="list" item="vo">
					<tr>
						<td style="padding-left:20px;">
						<input name="listorders[{$vo.id}]" type="text" size="3" value="{$vo.sort}" class="input input-order">
						</td>
						<php>$time=date('Y-m-d H:i:s',$vo['crtime'])</php>
						<td>{$time|default=''}</td>
						<td>
						<php>$img_url=sp_get_image_preview_url($vo['url']);</php>
						<img src="{$img_url}" style="height:36px;width: 36px;" onclick="parent.image_preview_dialog(this.src);">
						</td>
						<td>
						<if condition="$vo['goods_id']">
						{$vo.title}
						<else/>
						{$vo.jump|default=''}
						</if>
						</td>
						<td align="center">
						<a href="{:U('Goods/hpage_edit',array('id'=>$vo['id'],'type'=>0))}">编辑</a>
						<if condition="($vo.status eq 0)">
						| <a class="js-ajax-dialog-btn" data-msg="是否确认启用?" href="{:U('Goods/check_type_hp',array('id'=>$vo['id']))}">启用</a>	
						<else/>
						| <a class="js-ajax-dialog-btn" data-msg="是否确认关闭?" href="{:U('Goods/check_type_hp',array('id'=>$vo['id']))}">关闭</a>	
						</if>
						</td>
					</tr>
					</foreach>
				</tbody>
			</table>
			<div class="table-actions">
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit">排序</button>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>

</body>
</html>